home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / WarriorsProgress.sit / Warrior’s Progress / source code / Source / Libraries / Idle / Periodic.h < prev    next >
Text File  |  1997-06-28  |  613b  |  39 lines

  1. // Periodic.h
  2.  
  3. #ifndef Periodic_h
  4. #define Periodic_h
  5.  
  6. #ifndef Enableable_h
  7. #include "Enableable.h"
  8. #endif
  9. #ifndef DelayedMethod_h
  10. #include "DelayedMethod.h"
  11. #endif
  12.  
  13. class Periodic: public Enableable
  14.   {
  15.     private:
  16.         const Method& toRepeat;
  17.         DelayedMethod< Periodic > repeat;
  18.         uint32 period;
  19.         Tick nextTime;
  20.         bool inProgress;
  21.         
  22.         void Repeat();
  23.     
  24.         virtual void BeEnabled();
  25.         virtual void BeDisabled();
  26.         
  27.     public:
  28.         Periodic( const Method&,
  29.                      uint32 period,
  30.                      bool startEnabled = true );
  31.         
  32.         uint32 Period() const    { return period; }
  33.         void SetPeriod( uint32 );
  34.         
  35.         void Synchronize();
  36.   };
  37.  
  38. #endif
  39.